Imports System.IO

Public Class DateTimePickerDemo

    Public SearchDate As Date

    Sub FindFiles(ByVal Dir As String)
        Dim DirObj As New DirectoryInfo(Dir)

        Dim Files As FileInfo() = DirObj.GetFiles("*.*")
        Dim Dirs As DirectoryInfo() = DirObj.GetDirectories("*.*")

        Dim Filename As FileInfo

        For Each Filename In Files
            If (Filename.LastWriteTime > SearchDate) Then
                TextBox1.AppendText(Filename.FullName & vbCrLf)
            End If
        Next
        Dim DirectoryName As DirectoryInfo

        For Each DirectoryName In Dirs
            Try
                FindFiles(DirectoryName.FullName)
            Catch E As Exception
                MsgBox(E.Message)
            End Try
        Next

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SearchDate = DateTimePicker1.Value
        FindFiles("C:\VB2005.2")

    End Sub
End Class
